using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class SevenZip_CommandLineParser_SwitchForm_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(SevenZip.CommandLineParser.SwitchForm);

            field = type.GetField("IDString", flag);
            app.RegisterCLRFieldGetter(field, get_IDString_0);
            app.RegisterCLRFieldSetter(field, set_IDString_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_IDString_0, AssignFromStack_IDString_0);
            field = type.GetField("Type", flag);
            app.RegisterCLRFieldGetter(field, get_Type_1);
            app.RegisterCLRFieldSetter(field, set_Type_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Type_1, AssignFromStack_Type_1);
            field = type.GetField("Multi", flag);
            app.RegisterCLRFieldGetter(field, get_Multi_2);
            app.RegisterCLRFieldSetter(field, set_Multi_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_Multi_2, AssignFromStack_Multi_2);
            field = type.GetField("MinLen", flag);
            app.RegisterCLRFieldGetter(field, get_MinLen_3);
            app.RegisterCLRFieldSetter(field, set_MinLen_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_MinLen_3, AssignFromStack_MinLen_3);
            field = type.GetField("MaxLen", flag);
            app.RegisterCLRFieldGetter(field, get_MaxLen_4);
            app.RegisterCLRFieldSetter(field, set_MaxLen_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_MaxLen_4, AssignFromStack_MaxLen_4);
            field = type.GetField("PostCharSet", flag);
            app.RegisterCLRFieldGetter(field, get_PostCharSet_5);
            app.RegisterCLRFieldSetter(field, set_PostCharSet_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_PostCharSet_5, AssignFromStack_PostCharSet_5);


            app.RegisterCLRCreateArrayInstance(type, s => new SevenZip.CommandLineParser.SwitchForm[s]);

            args = new Type[]{typeof(System.String), typeof(SevenZip.CommandLineParser.SwitchType), typeof(System.Boolean), typeof(System.Int32), typeof(System.Int32), typeof(System.String)};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);
            args = new Type[]{typeof(System.String), typeof(SevenZip.CommandLineParser.SwitchType), typeof(System.Boolean), typeof(System.Int32)};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_1);
            args = new Type[]{typeof(System.String), typeof(SevenZip.CommandLineParser.SwitchType), typeof(System.Boolean)};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_2);

        }



        static object get_IDString_0(ref object o)
        {
            return ((SevenZip.CommandLineParser.SwitchForm)o).IDString;
        }

        static StackObject* CopyToStack_IDString_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((SevenZip.CommandLineParser.SwitchForm)o).IDString;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_IDString_0(ref object o, object v)
        {
            ((SevenZip.CommandLineParser.SwitchForm)o).IDString = (System.String)v;
        }

        static StackObject* AssignFromStack_IDString_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @IDString = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((SevenZip.CommandLineParser.SwitchForm)o).IDString = @IDString;
            return ptr_of_this_method;
        }

        static object get_Type_1(ref object o)
        {
            return ((SevenZip.CommandLineParser.SwitchForm)o).Type;
        }

        static StackObject* CopyToStack_Type_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((SevenZip.CommandLineParser.SwitchForm)o).Type;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Type_1(ref object o, object v)
        {
            ((SevenZip.CommandLineParser.SwitchForm)o).Type = (SevenZip.CommandLineParser.SwitchType)v;
        }

        static StackObject* AssignFromStack_Type_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            SevenZip.CommandLineParser.SwitchType @Type = (SevenZip.CommandLineParser.SwitchType)typeof(SevenZip.CommandLineParser.SwitchType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            ((SevenZip.CommandLineParser.SwitchForm)o).Type = @Type;
            return ptr_of_this_method;
        }

        static object get_Multi_2(ref object o)
        {
            return ((SevenZip.CommandLineParser.SwitchForm)o).Multi;
        }

        static StackObject* CopyToStack_Multi_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((SevenZip.CommandLineParser.SwitchForm)o).Multi;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_Multi_2(ref object o, object v)
        {
            ((SevenZip.CommandLineParser.SwitchForm)o).Multi = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_Multi_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @Multi = ptr_of_this_method->Value == 1;
            ((SevenZip.CommandLineParser.SwitchForm)o).Multi = @Multi;
            return ptr_of_this_method;
        }

        static object get_MinLen_3(ref object o)
        {
            return ((SevenZip.CommandLineParser.SwitchForm)o).MinLen;
        }

        static StackObject* CopyToStack_MinLen_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((SevenZip.CommandLineParser.SwitchForm)o).MinLen;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_MinLen_3(ref object o, object v)
        {
            ((SevenZip.CommandLineParser.SwitchForm)o).MinLen = (System.Int32)v;
        }

        static StackObject* AssignFromStack_MinLen_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @MinLen = ptr_of_this_method->Value;
            ((SevenZip.CommandLineParser.SwitchForm)o).MinLen = @MinLen;
            return ptr_of_this_method;
        }

        static object get_MaxLen_4(ref object o)
        {
            return ((SevenZip.CommandLineParser.SwitchForm)o).MaxLen;
        }

        static StackObject* CopyToStack_MaxLen_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((SevenZip.CommandLineParser.SwitchForm)o).MaxLen;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_MaxLen_4(ref object o, object v)
        {
            ((SevenZip.CommandLineParser.SwitchForm)o).MaxLen = (System.Int32)v;
        }

        static StackObject* AssignFromStack_MaxLen_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @MaxLen = ptr_of_this_method->Value;
            ((SevenZip.CommandLineParser.SwitchForm)o).MaxLen = @MaxLen;
            return ptr_of_this_method;
        }

        static object get_PostCharSet_5(ref object o)
        {
            return ((SevenZip.CommandLineParser.SwitchForm)o).PostCharSet;
        }

        static StackObject* CopyToStack_PostCharSet_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((SevenZip.CommandLineParser.SwitchForm)o).PostCharSet;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_PostCharSet_5(ref object o, object v)
        {
            ((SevenZip.CommandLineParser.SwitchForm)o).PostCharSet = (System.String)v;
        }

        static StackObject* AssignFromStack_PostCharSet_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @PostCharSet = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((SevenZip.CommandLineParser.SwitchForm)o).PostCharSet = @PostCharSet;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 6);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @postCharSet = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @maxLen = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Int32 @minLen = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            System.Boolean @multi = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 5);
            SevenZip.CommandLineParser.SwitchType @type = (SevenZip.CommandLineParser.SwitchType)typeof(SevenZip.CommandLineParser.SwitchType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 6);
            System.String @idString = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = new SevenZip.CommandLineParser.SwitchForm(@idString, @type, @multi, @minLen, @maxLen, @postCharSet);

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* Ctor_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @minLen = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Boolean @multi = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            SevenZip.CommandLineParser.SwitchType @type = (SevenZip.CommandLineParser.SwitchType)typeof(SevenZip.CommandLineParser.SwitchType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            System.String @idString = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = new SevenZip.CommandLineParser.SwitchForm(@idString, @type, @multi, @minLen);

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* Ctor_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @multi = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            SevenZip.CommandLineParser.SwitchType @type = (SevenZip.CommandLineParser.SwitchType)typeof(SevenZip.CommandLineParser.SwitchType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.String @idString = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = new SevenZip.CommandLineParser.SwitchForm(@idString, @type, @multi);

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
